/**
 * @Project RSLsXWG
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Jun 15, 2011
 * @Createtime 4:34:23 PM
 */

package com.xwg.cards
{
	import flash.display.Bitmap;
	import flash.display.Sprite;

	public class CardFaceAAA extends Sprite
	{

		// CLUBS
		[Embed(source = "assets/C1.png")]
		public static var C1:Class;

		[Embed(source = "assets/C2.png")]
		public static var C2:Class;

		[Embed(source = "assets/C3.png")]
		public static var C3:Class;

		[Embed(source = "assets/C4.png")]
		public static var C4:Class;

		[Embed(source = "assets/C5.png")]
		public static var C5:Class;

		[Embed(source = "assets/C6.png")]
		public static var C6:Class;

		[Embed(source = "assets/C7.png")]
		public static var C7:Class;

		[Embed(source = "assets/C8.png")]
		public static var C8:Class;

		[Embed(source = "assets/C9.png")]
		public static var C9:Class;

		[Embed(source = "assets/C10.png")]
		public static var C10:Class;

		[Embed(source = "assets/C11.png")]
		public static var C11:Class;

		[Embed(source = "assets/C12.png")]
		public static var C12:Class;

		[Embed(source = "assets/C13.png")]
		public static var C13:Class;

		// DIAMONDS
		[Embed(source = "assets/D1.png")]
		public static var D1:Class;

		[Embed(source = "assets/D2.png")]
		public static var D2:Class;

		[Embed(source = "assets/D3.png")]
		public static var D3:Class;

		[Embed(source = "assets/D4.png")]
		public static var D4:Class;

		[Embed(source = "assets/D5.png")]
		public static var D5:Class;

		[Embed(source = "assets/D6.png")]
		public static var D6:Class;

		[Embed(source = "assets/D7.png")]
		public static var D7:Class;

		[Embed(source = "assets/D8.png")]
		public static var D8:Class;

		[Embed(source = "assets/D9.png")]
		public static var D9:Class;

		[Embed(source = "assets/D10.png")]
		public static var D10:Class;

		[Embed(source = "assets/D11.png")]
		public static var D11:Class;

		[Embed(source = "assets/D12.png")]
		public static var D12:Class;

		[Embed(source = "assets/D13.png")]
		public static var D13:Class;

		// HEARTS
		[Embed(source = "assets/H1.png")]
		public static var H1:Class;

		[Embed(source = "assets/H2.png")]
		public static var H2:Class;

		[Embed(source = "assets/H3.png")]
		public static var H3:Class;

		[Embed(source = "assets/H4.png")]
		public static var H4:Class;

		[Embed(source = "assets/H5.png")]
		public static var H5:Class;

		[Embed(source = "assets/H6.png")]
		public static var H6:Class;

		[Embed(source = "assets/H7.png")]
		public static var H7:Class;

		[Embed(source = "assets/H8.png")]
		public static var H8:Class;

		[Embed(source = "assets/H9.png")]
		public static var H9:Class;

		[Embed(source = "assets/H10.png")]
		public static var H10:Class;

		[Embed(source = "assets/H11.png")]
		public static var H11:Class;

		[Embed(source = "assets/H12.png")]
		public static var H12:Class;

		[Embed(source = "assets/H13.png")]
		public static var H13:Class;

		// SPADES
		[Embed(source = "assets/S1.png")]
		public static var S1:Class;

		[Embed(source = "assets/S2.png")]
		public static var S2:Class;

		[Embed(source = "assets/S3.png")]
		public static var S3:Class;

		[Embed(source = "assets/S4.png")]
		public static var S4:Class;

		[Embed(source = "assets/S5.png")]
		public static var S5:Class;

		[Embed(source = "assets/S6.png")]
		public static var S6:Class;

		[Embed(source = "assets/S7.png")]
		public static var S7:Class;

		[Embed(source = "assets/S8.png")]
		public static var S8:Class;

		[Embed(source = "assets/S9.png")]
		public static var S9:Class;

		[Embed(source = "assets/S10.png")]
		public static var S10:Class;

		[Embed(source = "assets/S11.png")]
		public static var S11:Class;

		[Embed(source = "assets/S12.png")]
		public static var S12:Class;

		[Embed(source = "assets/S13.png")]
		public static var S13:Class;

		private var _imgs:Vector.<Bitmap>;

		public function CardFaceAAA()
		{
			super();

			_imgs = new Vector.<Bitmap>();

			// CLUBS
			_imgs[0] = new CardFaceAAA.C1 as Bitmap;
			_imgs[1] = new CardFaceAAA.C2 as Bitmap;
			_imgs[2] = new CardFaceAAA.C3 as Bitmap;
			_imgs[3] = new CardFaceAAA.C4 as Bitmap;
			_imgs[4] = new CardFaceAAA.C5 as Bitmap;
			_imgs[5] = new CardFaceAAA.C6 as Bitmap;
			_imgs[6] = new CardFaceAAA.C7 as Bitmap;
			_imgs[7] = new CardFaceAAA.C8 as Bitmap;
			_imgs[8] = new CardFaceAAA.C9 as Bitmap;
			_imgs[9] = new CardFaceAAA.C10 as Bitmap;
			_imgs[10] = new CardFaceAAA.C11 as Bitmap;
			_imgs[11] = new CardFaceAAA.C12 as Bitmap;
			_imgs[12] = new CardFaceAAA.C13 as Bitmap;

			// DIAMONDS
			_imgs[13] = new CardFaceAAA.D1 as Bitmap;
			_imgs[14] = new CardFaceAAA.D2 as Bitmap;
			_imgs[15] = new CardFaceAAA.D3 as Bitmap;
			_imgs[16] = new CardFaceAAA.D4 as Bitmap;
			_imgs[17] = new CardFaceAAA.D5 as Bitmap;
			_imgs[18] = new CardFaceAAA.D6 as Bitmap;
			_imgs[19] = new CardFaceAAA.D7 as Bitmap;
			_imgs[20] = new CardFaceAAA.D8 as Bitmap;
			_imgs[21] = new CardFaceAAA.D9 as Bitmap;
			_imgs[22] = new CardFaceAAA.D10 as Bitmap;
			_imgs[23] = new CardFaceAAA.D11 as Bitmap;
			_imgs[24] = new CardFaceAAA.D12 as Bitmap;
			_imgs[25] = new CardFaceAAA.D13 as Bitmap;

			// HEARTS
			_imgs[26] = new CardFaceAAA.H1 as Bitmap;
			_imgs[27] = new CardFaceAAA.H2 as Bitmap;
			_imgs[28] = new CardFaceAAA.H3 as Bitmap;
			_imgs[29] = new CardFaceAAA.H4 as Bitmap;
			_imgs[30] = new CardFaceAAA.H5 as Bitmap;
			_imgs[31] = new CardFaceAAA.H6 as Bitmap;
			_imgs[32] = new CardFaceAAA.H7 as Bitmap;
			_imgs[33] = new CardFaceAAA.H8 as Bitmap;
			_imgs[34] = new CardFaceAAA.H9 as Bitmap;
			_imgs[35] = new CardFaceAAA.H10 as Bitmap;
			_imgs[36] = new CardFaceAAA.H11 as Bitmap;
			_imgs[37] = new CardFaceAAA.H12 as Bitmap;
			_imgs[38] = new CardFaceAAA.H13 as Bitmap;

			// SPADES
			_imgs[39] = new CardFaceAAA.S1 as Bitmap;
			_imgs[40] = new CardFaceAAA.S2 as Bitmap;
			_imgs[41] = new CardFaceAAA.S3 as Bitmap;
			_imgs[42] = new CardFaceAAA.S4 as Bitmap;
			_imgs[43] = new CardFaceAAA.S5 as Bitmap;
			_imgs[44] = new CardFaceAAA.S6 as Bitmap;
			_imgs[45] = new CardFaceAAA.S7 as Bitmap;
			_imgs[46] = new CardFaceAAA.S8 as Bitmap;
			_imgs[47] = new CardFaceAAA.S9 as Bitmap;
			_imgs[48] = new CardFaceAAA.S10 as Bitmap;
			_imgs[49] = new CardFaceAAA.S11 as Bitmap;
			_imgs[50] = new CardFaceAAA.S12 as Bitmap;
			_imgs[51] = new CardFaceAAA.S13 as Bitmap;

			for (var i:uint = 0; i < 52; i++)
			{
				_imgs[i].smoothing = true;
				_imgs[i].visible = false;

				addChild(_imgs[i]);
			}
		}

		public function gotoAndStop(position:int):void
		{
			_hideAllImgs();

			if (position >= 1 && position <= 52)
			{
				_imgs[position - 1].visible = true;
			}
		}

		private function _hideAllImgs():void
		{
			for (var i:uint = 0; i < 52; i++)
			{
				_imgs[i].visible = false;
			}
		}
	}
}
